<?
if (!defined('_GNUBOARD_')) exit;

// 카테고리 레이어
function getCategoty($bo_table)
{
	global $config, $member, $g4, $urlencode, $is_admin, $category_location;
	
    $category_skin_path = "$g4[path]/skin/board/basic2/";

    // 카테고리 목록을 가져온다
    $sql =  "SELECT CATEGORY_CODE,                                                                                ";
	$sql .= "       CATEGORY_NAME,                                                                                ";
	$sql .= "       CATEGORY_DEPTH,                                                                               ";
	$sql .= "       (select count(1) from g4_write_$bo_table b where wr_is_comment=0 and instr(b.ca_name, a.category_code) = 1) ca_cnt ";
	$sql .= "  FROM g4_category a                                                                                 ";
	$sql .= "ORDER BY CATEGORY_CODE ASC                                                                           ";
    
    
    $category_arr = array();
    $category_arr = sql_query($sql);
    
    ob_start();
    include_once ($category_skin_path."category.skin.php");
    $content = ob_get_contents();
    ob_end_clean();

    return $content;
}
?>